package br.com.informatos.intentactions;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Button btnSite = (Button) findViewById(R.id.btn_site);
		Button btnEmail = (Button) findViewById(R.id.btn_email);
		Button btnLigar = (Button) findViewById(R.id.btn_call);	
		
		btnSite.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://k19.com.br"));
				startActivity(intent);

			}
		});


		btnEmail.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Intent.ACTION_SEND);
				intent.setType("plain/text");
				intent.putExtra(Intent.EXTRA_EMAIL, new String[] {"contato19.com.br"});
				startActivity(Intent.createChooser(intent, "Enviar Email"));				

			}

		});
		
		
		btnLigar.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:0989613-6622"));
				startActivity(intent);
				
			}
		});




	}

}
